package com.sailfish.springbootdemo.controller.db2;

import com.alibaba.fastjson.JSONObject;
import com.sailfish.springbootdemo.pojo.Result;
import com.sailfish.springbootdemo.pojo.db2.PcbPermissionConfig;
import com.sailfish.springbootdemo.service.db2.PcbPermissionConfigService;
import com.sailfish.springbootdemo.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/permissionConfig")
public class PermissionConfigController {

    @Autowired
    PcbPermissionConfigService pcbPermissionConfigService;

    @PostMapping("/getPermissionList")
    public Result getPermissionList() {
        List<PcbPermissionConfig> permissionConfigList = pcbPermissionConfigService.getPermissionConfigList();
        return ResultUtil.success(permissionConfigList);
    }

    @PostMapping("/updateAuditor")
    public Result update(Integer id, Integer approver, String remark) {
        Result result = pcbPermissionConfigService.update(id, approver, remark);
        return result;
    }

}
